<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:ry="">
	<head>
		<th:block th:include="include :: header('修改通知公告')" />
		<th:block th:include="include :: summernote-css" />
	</head>
	<body class="white-bg">
	    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
	        <form class="form-horizontal m" id="form-notice-edit">
	            <input type="hidden" id="notice_id" name="notice_id" th:value="${notice['notice_id']}"/>
	            <div class="form-group">
	                <label class="col-sm-2 control-label is-required">公告标题：</label>
	                <div class="col-sm-10">
	                    <input id="notice_title" name="notice_title" th:value="${notice['notice_title']}" class="form-control" />
	                </div>
	            </div>
	            <div class="form-group">
					<label class="col-sm-2 control-label is-required">公告类型：</label>
					<div class="col-sm-10">
						<ry:selectDict dictType="sys_notice_type" name="notice_type" class="form-control m-b" th:value="${notice['notice_type']}"/>
					</div>
				</div>
	            <div class="form-group">
	                <label class="col-sm-2 control-label is-required">公告内容：</label>
	                <div class="col-sm-10">
                        <textarea name="notice_content" id="notice_content">[[${notice['notice_content']}]]</textarea>
	                </div>
	            </div>
	            <div class="form-group">
					<label class="col-sm-2 control-label">公告状态：</label>
					<div class="col-sm-10">
						<ry:radioDict dictType="sys_notice_status" name="status" class="radio-box" required="true" th:value="${notice['status']}"/>
					</div>
				</div>
			</form>
	    </div>
	    <th:block th:include="include :: footer" />
	    <th:block th:include="include :: summernote-js" />
	    <script type="text/javascript">
	        var prefix = ctx + "system/notice";

		    $(function() {
                $("#form-notice-edit").validate({
                    focusCleanup: true
                });
                //初始化summernote富文本控件
		        $.rySummernote.init($("#notice_content"), "请输入公告内容", 200);
		    });

			function submitHandler() {
		        if ($.validate.form()) {
		            var notice_content = $("#notice_content").summernote("code");
                    if($.common.isEmpty(notice_content) || notice_content == "<p><br></p>") {
                        $.modal.alertWarning("请输入公告内容");
                        return;
                    }
					$.operate.save(prefix + "/save", $('#form-notice-edit').serialize());
		        }
		    }
		</script>
	</body>
</html>